﻿using System;

class Program
{
    static void Main(string[] args)
    {
        var shapes = new IShape[]
        {
            new Rectangle(5, 3),
            new Square(4),
            new Triangle(3, 4, 5)
        };

        foreach (var shape in shapes)
        {
            if (shape.IsValid())
            {
                Console.WriteLine($"Shape is valid with area: {shape.Area}");
            }
            else
            {
                Console.WriteLine("Shape is not valid.");
            }
        }
    }
}